<extend name="Public/base"/>

<block name="body">
    <link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css/bootstrap.css" media="all">
    <div class="main-title">
        <h2>用户资料 <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button></h2>
    </div>
    <div >
        <table class="table data-table table-striped table-bordered table-condensed">
            <tbody>
                <tr>
                    <td class="text-right">用户名：</td>
                    <td>{$id|get_username}</td>
                    <td class="text-right">头像：</td>
                    <td><img class="img-thumbnail" src="{:url_format($avatar)}" width="60" /></td>
                </tr>
                <tr>
                    <td class="text-right">用户昵称：</td>
                    <td>{$nickname}</td>
                    <td class="text-right">背景：</td>
                    <td><img src="{:url_format($background)}" width="200" /></td>
                </tr>
                <tr>
                    <td class="text-right">性别：</td>
                    <td>{$gender}</td>
                    <td class="text-right">年龄：</td>
                    <td>{$age}</td>
                </tr>
                <tr>
                    <td class="text-right">星座：</td>
                    <td>{$stars}</td>
                    <td class="text-right">擅长游戏：</td>
                    <td>{$game}</td>
                </tr>
                <tr>
                    <td class="text-right">兴趣爱好：</td>
                    <td colspan="3">{$interest|default="-"}</td>
                </tr>
                <tr>
                    <td class="text-right">用户所在地：</td>
                    <td colspan="3" >{$address|default="-"}</td>
                </tr>
                <tr>
                    <td class="text-right">个人简介：</td>
                    <td colspan="3" >{$desc|default="-"}</td>
                </tr>
                <tr>
                    <td class="text-right">认证图标：</td>
                    <td colspan="3" ><notempty name="auth_icon">
                        <img alt="{$auth_icon.name}" title="{$auth_icon.name}" src="{$auth_icon.pic}" width="50">
                            <a href="#" class="JS-bindIcon" data-id="0">取消</a>
                        <br/>  
                        {$auth_icon.name}
                    </notempty></td>
                </tr>
            </tbody>
        </table>
    </div>    
    <div>
        认证图标集 (点击确认)
         <table class="table data-table table-striped table-bordered table-condensed">
            <tbody>
            <tr>
            <td>
                <volist name="auth_icon_pack" id="v">
                        <div class="JS-bindIcon" data-id="{$v.id}" style="cursor: pointer; display: inline-block; padding: 5px; text-align: center;">
                        <img alt="{$v.name}" title="{$v.name}" src="{$v.pic}" style="height: 50px"><br/>
                        <span style="text-align: center;">{$v.name}</span>
                        </div>
                </volist>
            </td>
            </tr>
            </tbody>
            </table>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('index')}');
        var uri = "{:U('auth_icon')}";
        var uid = {$id};
        $('.JS-bindIcon').click(function(){
            var icon_id = $(this).data('id');
            $.post(uri, {uid: uid, id: icon_id}, function(res){
                updateAlert(res.info,'alert-success');
                location.reload();
            });
        });
    </script>
</block>
